Repository navigation
fix(lint): state-machine-no-initial-states judges only insert-running machines, and field-group-shadowed judges the six highlights the record page draws - #35629
Conversation
…run on insert An update-only state machine (events without insert) never runs on create, so the engine never reads its initialStates; the rule no longer refuses it. The three showcase machines that carried a declaration-only initialStates list to pass the rule drop it. Claude-Session: https://claude.ai/code/session_01L6bhgUZrkMKgGrXXe8zPGq Co-authored-by: Claude <noreply@anthropic.com>
…page hoists The record page draws the first six highlightFields in its header strip and leaves them out of the Details body; the lint judged four, so a group emptied by the fifth or sixth highlight passed. The count is now one constant, RECORD_HIGHLIGHTS_MAX in @objectstack/spec/ui, read by the lint and by the record page synthesizer in @object-ui/plugin-detail. Claude-Session: https://claude.ai/code/session_01L6bhgUZrkMKgGrXXe8zPGq Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check6 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 174 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 04c80f1a8002a4786164316dfb6f5814db218bd2 && git checkout 04c80f1a8002a4786164316dfb6f5814db218bd2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5c5b54d3faecbac18a642c70139df295639b985c 1c2b804052a59a3aa0d5b798da42ac3d81d80212 && git checkout -B drift-repro 5c5b54d3faecbac18a642c70139df295639b985c && git merge --no-ff 1c2b804052a59a3aa0d5b798da42ac3d81d80212
node scripts/docs-audit/affected-docs.mjs --json 5c5b54d3faecbac18a642c70139df295639b985c |
…arm beside narrowed Metadata-protocol narrowed is a breaking narrowing by definition, so the Clause-② line carries (narrowing), not (widening). Claude-Session: https://claude.ai/code/session_01L6bhgUZrkMKgGrXXe8zPGq Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-sales · session_01L6bhgUZrkMKgGrXXe8zPGq Final green head · 2026-11-19T20:14Z · Generated by Claude Code |
|
repo:objectstack#1 · os-sales · session_01L6bhgUZrkMKgGrXXe8zPGq Contract review brief — PR #35629 @
|
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUZrkMKgGrXXe8zPGq Contract reviewServed-tier: Isolated review of PR #35629 for cards #35251 and #35252 (folded, chain head #35251). Read: both cards with every comment, the PR body and file list, the net diff ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Nits, none of which changes a verdict of this diff:
Implemented-by: VERDICT: PASS |
…ate-machine-update-only
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob L2 adoption · 2026-11-19T20:21Z · The seat adopts area b1-C's isolated record 7021133187 for head |
|
repo:objectstack#1 · os-sales · session_01L6bhgUZrkMKgGrXXe8zPGq CI reading · 2026-11-19T21:03Z · head Generated by Claude Code |
|
repo:objectstack#1 · os-sales · session_01L6bhgUZrkMKgGrXXe8zPGq Landing · 2026-11-19T21:28Z · head
State change: Generated by Claude Code |
Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgUZrkMKgGrXXe8zPGq
Fixes #35251
Part of #35252 — folded into this PR whole; the chain head #35251 carries the fold's record, so #35252 is shut by hand with a Delivered note after merge.
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #35245 — an update-only state machine needs no
initialStates(skills/objectstack-data/SKILL.md, skills/objectstack-automation/references/state-machines-and-approvals.md; scope note 7018552906); the six-highlight strip is taught nowhere inskills/**维护者速读
What changes
Two cards, one mechanism: a
packages/lintrule judged a scope the runtime does not. One commit per card, #35251 first.#35251 —
state-machine-no-initial-statesjudges only machines that run on insertpackages/lint/src/validate-inert-object-declarations.ts) now skips astate_machinewhoseeventsleave outinsert. PredicaterunsOnInsert(events): absent (or null) takes the schema default, an explicit list must containinsert; so['update']and[]are not judged. The hint is unchanged.packages/spec/src/data/validation.zod.ts:149declaresevents: z.array(z.enum(['insert','update'])).default(['insert','update']), so an omittedeventsruns on insert.packages/objectql/src/validation/rule-validator.ts:3938-3939drops every rule whoseevents ?? ['insert','update']does not include the write mode, beforecheckStateMachineruns; itsinitialStatesbranch isif (mode === 'insert')at:4209. An update-only machine therefore never readsinitialStates.showcase_accountaccount_lifecycle['prospect'],showcase_projectproject_health_progression['green'],showcase_tasktask_status_flow['backlog','todo']. Each machine is now byte-identical to its form before feat(lint): five publish-time checks for metadata the runtime ignores, and four build probes over what landed #35244 (git diff f4dbcc21^on each of the three files: 0 changed lines). No showcase test or doc asserts them:seed.test.tsreads only machines that declareinitialStates, andnew-project-wizard-initial-status.test.tsandseed/index.tsreadproject_status_flow, which runs on insert and keeps['planned'].initialStates.describe()invalidation.zod.ts(+ regeneratedcontent/docs/references/data/validation.mdx), theos explainparagraph inrule-explanations.ts, and the unreleased upgrade-guide entry18.publish-refuses-metadata-the-runtime-ignores.ts.#35252 —
field-group-shadowedjudges the six highlights the record page hoistsRECORD_HIGHLIGHTS_MAX = 6inpackages/spec/src/ui/component.zod.ts(@objectstack/spec/ui), the one source.@objectstack/lintdepends on@objectstack/specand on nothing underui/**, so the constant lives there and the UI imports it.ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.tsre-exports it as its ownRECORD_HIGHLIGHTS_MAX(module export only; the package entry never exported it) — same value, the page is unchanged.packages/lint/src/validate-semantic-roles.tsrule (d) cuts atRECORD_HIGHLIGHTS_MAXinstead ofslice(0, 4), and its hint reads "first 6 highlightFields".deriveHighlightFields),hidden: truemembers not counted.18.field-group-shadowed-six-highlights.ts, ADR-0087 dispositionregistered field-group-shadowed-six-highlights.Which stacks the rule now refuses that it passed: an object with a field group whose every visible member is the title or a highlight in position 5 or 6 (after the title leaves the list) gets a
field-group-shadowedwarning;os lint --strict/os validate --strictexits 1 on it. Measured on this tree: every*.object.tsunderpackages/**andexamples/**(135 objects from 132 files, old 4-cut vs new 6-cut side by side) — 0 new findings, 0 removed; the 2 files that would not load in the scratch harness (plugin-auditsys-activitywith 4 highlights,sys-audit-logwith none) cannot change verdict.The card's "a valid list is refused" half does not hold. The strip hides the first N, so the fields the first 4 hide are a subset of the fields the first 6 hide: every list the 4-cut warned, the 6-cut warns too. The hotcrm example confirms it:
owner_idsixth also empties theassignmentgroup on the 18.6.0 page, so dropping it was the right fix, and the 4-cut passing the sixth position was the defect. No carve-out was added.Tests
validate-inert-object-declarations.test.ts: new negative pins (update-only machine andevents: []with noinitialStatesare silent; anobjectwrite whose only machine is update-only passes the runtime publish gate) and a control (explicit['insert'],['update','insert']and the default are still refused,rulecode andpathasserted).validate-semantic-roles.test.ts: new pin — a group whose only member sits 5th or 6th is warned (rule,severity,path, the group, and the hint's "first 6"), with a 4-of-6 control that stays clean. Fixture triage: two fixtures pinned the 4-cut itself — the strip-cap case (now 8 entries, the 7th past the cap) and theprimaryField不是可声明键(ObjectSchema 以 unrecognized_keys 拒收),但两条 lint 规则与 objectstack-data 技能文档都把它当作合法 name 面 #6326primaryFieldpair (now 7 entries) — both replaced so each still discriminates under 6.git diff HEADempty, printed byscripts/ablation-replace.mjs):if (!runsOnInsert(rule.events)) continue;→ 2 failed / 7 passed (the two update-only pins);slice(0, RECORD_HIGHLIGHTS_MAX)→slice(0, 4)→ 2 failed / 29 passed (the six-highlight pin and theprimaryField不是可声明键(ObjectSchema 以 unrecognized_keys 拒收),但两条 lint 规则与 objectstack-data 技能文档都把它当作合法 name 面 #6326 pair).Acceptance notes
initialStatesresidual (comment 6992730706,crm_opportunityin app-crm). Not touched; the rule still passes an every-option list.headerDrawnFieldsalso drops the stage field from the body when the page drawsrecord:path(detectStatusField+ options). A group whose only member is that field is empty on the page and not warned. Read only, not reproduced on a running page; filed as lint: field-group-shadowed does not count the stage field the record page draws as record:path, so a group whose only member is it shows empty without a warning #35630 (read only, not reproduced).HIGHLIGHT_FIELDS_MAX(Studio's highlight editor) andHIGHLIGHTS_MAXinui/packages/fields/src/RecordHoverCard.tsx. Both agree today; they could read the spec constant too..changeset/34776-publish-checks-build-probes.mdsentence ("an activestate_machinevalidation withoutinitialStates… lets a record be created already in any state") is unreleased and now broader than the rule; this PR's changeset states the narrowing in the same release rather than editing that note.Verification
Two-minute check:
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-inert-object-declarations.test.ts src/validate-semantic-roles.test.ts— expect 2 files, 40 tests, all green.Read first:
packages/lint/src/validate-inert-object-declarations.ts—runsOnInsert, the predicate (a wrong default here re-opens or hides the whole rule).packages/lint/src/validate-semantic-roles.tsrule (d) — the cut moves from 4 to the spec constant.packages/spec/src/ui/component.zod.ts— the newRECORD_HIGHLIGHTS_MAXexport (a public spec surface).Local readings for head 1c2b804 (the final head: a clean merge of origin/main 5c5b54d onto 18224af; the PR's own diff vs main is unchanged, same
git patch-id --stable43a14c36). The package and gate readings below were taken at f76bbfb; 18224af changes only the Clause-② line of the #35252 changeset. On the merge head the spec build +check:generated(14 of 14 up to date), the two lint test files (40 tests), the spec migration tests (198 tests), the ADR-0087 registration, no-major, NUL-byte and overlap checks were rerun, all exit 0.Package tests and typechecks
pnpm --filter @objectstack/lint typecheck && pnpm --filter @objectstack/lint test— VERDICT command-exit 0; Test Files 221 passed, Tests 9311 passed.pnpm --filter @objectstack/spec test— VERDICT command-exit 0; Test Files 855 passed, 1 skipped; Tests 27388 passed.pnpm --filter @objectstack/spec typecheck— exit 0.pnpm --filter @object-ui/plugin-detail type-check— exit 0 (after building its dependency closure);vitest run packages/plugin-detail/fromui/— VERDICT command-exit 0; Test Files 388 passed, 1 skipped; Tests 3536 passed.pnpm --filter @objectstack/spec exec vitest run src/migrations/— 5 files, 198 tests passed.pnpm --filter @objectstack/example-showcase exec vitest run --maxWorkers=2— VERDICT command-exit 0; Test Files 48 passed, Tests 549 passed.Derived gate families (dispatch-gates --commands, 125)
check:api-surface,check:generated,check:i18n-coverage,check:dual-build-cjs-loadsand the rest first answered PREREQUISITE NOT MET, exit 3).node scripts/check-plugin-teardown-shape.mjs --self-test, reason: shallow checkout cannot reach its pinned positive-control commit (exit 3); CI runs it.dispatch-gates --ran: 125 derived, 124 run, 1 NOT-MEASURED (derived from a recorded exit 3), 0 UNRUN.node scripts/check-adr-0087-registration.mjs --base origin/main— exit 0, one declared-breaking changeset, registeredfield-group-shadowed-six-highlights.Not run locally, owned by CI:
test:repo, the repo-widepnpm lint. Dogfood (owed once on the final head by the(narrowing)arm):pnpm --filter @objectstack/dogfood teston 18224af under the verify lock — VERDICT command-exit 0; Test Files 482 passed, 3 skipped; Tests 4092 passed, 68 skipped; 0 failed (os-dev-report 7019779056).🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUZrkMKgGrXXe8zPGq
Generated by Claude Code